package Static.practice.Product;

public class Main {
    public static void main(String[] args) {
        Product phone = new Product("手机", 2001);
        Product computer = new Product("电脑", 5001);
        Product headSet = new Product("耳机", 1001);
        Product keyBoard = new Product("键盘", 400);
        Product mouse = new Product("鼠标", 500);

        phone.changePrice(3001);
        phone.setNum(1000);
        System.out.println("库存" + phone.getNum() + "台手机");

        if (phone.buy(2000))
            System.out.println("购买2000台手机");
        else
            System.out.println("库存不足");

        System.out.println(phone.getInfo());
        System.out.println(computer.getInfo());
        System.out.println(headSet.getInfo());
        System.out.println(keyBoard.getInfo());
        System.out.println(mouse.getInfo());
    }
}
